package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /*
    * 根据openid查找用户信息
    * */
    @Select("select * from user where openid=#{openid}")
    User selectByOpenid(String openid);

    /*
    * 注册用户
    * */
    void insert(User user);

    /*
     * 根据id查找用户信息
     * */
    @Select("select * from user where id=#{id}")
    User selectById(Long id);

    /*
    * 根据日期范围查询用户数量
    * */
    Integer getUserNumber(Map<String, Object> map);
}
